package com.smartleanx.module.hrm.service.esign.temp.result;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * e签宝模板控件返回
 *
 * @author xzq
 * @since 2025-07-07 16:43:52
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "模板控件返回")
public class ComponentBathResult implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "任务id")
    private String taskId;

    @Schema(description = "1/企业 2/员工")
    private Integer fillInType;

    @Schema(description = "1/暂存 2/保存")
    private Integer saveType;

    @Schema(description = "表头")
    private List<Column> columnList;

    @Schema(description = "列值")
    private List<ColumnValue> columnValueList;

    @Schema(description = "列值map")
    private List<Map<Object,Object>> columnValueMap;

    @Data
    public static class Column{
        @TableId(value = "id", type = IdType.ASSIGN_ID)
        private Long id;

        @Schema(description = "列名")
        private String columnName;

        @Schema(description = "列code")
        private String columnCode;

        @Schema(description = "控件类型")
        private Integer componentType;

        @Schema(description = "填写类型")
        private Integer fillInType;

        @Schema(description = "是否可填写")
        private Integer fillInUpdate;

        @Schema(description = "是否必填")
        private Integer required;

        @Schema(description = "表头")
        private List<Column> children;

        @Schema(description = "下拉数据")
        private List<Map<String,Object>> selectOption;
    }

    @Data
    public static class ColumnValue{
        @Schema(description = "列id")
        private Long columnId;

        @Schema(description = "控件类型")
        private Integer componentType;

        @Schema(description = "填写类型")
        private Integer fillInType;

        @Schema(description = "是否可填写")
        private Integer fillInUpdate;

        @Schema(description = "列值")
        private String columnValue;

        @Schema(description = "任务id")
        private Long taskId;

        @Schema(description = "任务列id")
        private Long taskColumnId;

        @Schema(description = "列code")
        private String columnCode;

    }
}
